<%--
  Created by IntelliJ IDEA.
  User: TYK
  Date: 2020/7/2
  Time: 22:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>单文件上传</title>
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
</script>
</head>
<br>
    <h2>单文件上传</h2>
    <form method="post" action="/upload" enctype="multipart/form-data">
        <input type="file" name="file" multiple="multiple"/><br/>
        <input type="submit" value="单文件提交"/>
    </form></br>
    <h2>多文件上传</h2>
    <form method="post" action="/multiUpload" enctype="multipart/form-data">
        <input type="file" name="file" multiple="multiple"/><br/>
        <input type="submit" value="提交"/>
    </form></br>
    <h2>多文件上传至FTP</h2>
    <form method="post" action="/updateAvater" enctype="multipart/form-data">
        <input type="file" name="file" multiple="multiple"/><br/>
        <input type="submit" value="提交"/>
    </form></br>
    <h2>文件FTP下载</h2>
    <form method="post" action="/downloadFile" enctype="multipart/form-data">
        <input type="file" name="file" multiple="multiple"/><br/>
        <input type="submit" value="提交"/>
    </form></br>
    <a href="ftp://ftptest:paw123###@47.105.54.191:21/home/wwwroot/ftptest/4e0ac8dda5134b8ab34e58ee5b09929c.png" download="myfile" > FTP下载 </a></br>
    <button onclick="downloadFile()" type="button">文件ftp下载</button>
    <h2>Excel导入</h2>
    <form method="post" action="/excel/import" enctype="multipart/form-data">
        <input type="file" name="file" multiple="multiple"/><br/>
        <input type="submit" value="提交"/>
    </form></br>
</body>
<script>
    function downloadFile() {
        $.ajax({
            type : 'POST',
            url : "/downloadFileLocal",//请求controller的路径,
            // data :{fileName : "4e0ac8dda5134b8ab34e58ee5b09929c.png"},
        success : function s(d){
            //请求成功，给照片处可以用下面的方法给src属性赋值
            // $("#boy").attr('src',d.map['boy']);
            // $("#girl").attr('src',d.map['girl']);
        }
    })
    }
</script>
</html>
